<?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class AjaxController extends CAjaxController
{
	public function filters()
    {
        return array(
            'accessControl',
        );
    }

    public function accessRules()
    {
        return array(
            array('allow',
                'users'=>array('@'),
            ),
        );
    }

	public function actionIndex() {
		

		$criteria=new CDbCriteria(array(
			'order' => 'parent_id ASC, position ASC',
		));

		$dataProvider = new CActiveDataProvider('Category', array(
			'criteria' => $criteria,
		));

		$html = $this->getOutput('/category/manage', array(
			'dataProvider'=>$dataProvider,
		));

		$this->ajaxResponse($html);
	}
}